package interfaces;


import java.util.Date;
import java.util.Set;

import domain.items.Post;

public interface SearchDataBase {
	/**
	 * when a new post is added, for each word in the post we need to add
	 * a reference in the IndexDB.
	 * @param word - a word that is in the Post
	 * @param post - a new or edited post
	 */
	public void addWordReference(String word, Post post);
	
	/**
	 * for a word that has been removed from the post, we need to delete the reference
	 * in the IndexDB
	 * @param word - a word that is no longer in the post
	 * @param post - a post that need to be deleted
	 */
	public void removeWordReference(String word, Post post);
	
	/**
	 * @param word
	 * @return a list of all the posts that contains the above word
	 */
	public Set<Post> getWordReference(String word);
		

	/**
	 * remove a reference from the userName to the list of posts that he has written
	 * @param userName
	 * @param post
	 */
	public void removeUserPost(String userName, Post post);
	/**
	 * @param userName
	 * @return a vector conatining all the posts that the above user has written
	 */
	public Set<Post> getUserPosts(String userName); 

	/**
	 * @param start
	 * @param end
	 * @return a vector with all the posts published between the dates 'start' - 'end'
	 */
	public Set<Post> getPostsByDate(Date start, Date end);
	

}
